<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEvaluatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('c_evaluates')) {
            Schema::create('c_evaluates', function (Blueprint $table) {
                $table->increments('id')->comment('ID');
                $table->integer('goods_id')->default(0)->comment('商品ID');
                $table->integer('user_id')->default(0)->comment('用户ID');
                $table->integer('score')->default(0)->comment('分数');
                $table->tinyInteger('types')->default(0)->comment('商品类型(1:课程,2:商品,3:医师)');
                $table->text('content')->default(null)->comment('评论内容');
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('c_evaluates');
    }
}
